/*
 * SteepTimer - A timer designed for tea fanatics
 * Copyright (C) 2011  Wesley Crossman
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef TEAICON_H
#define TEAICON_H

#include <QPixmap>
#include <QHash>
#include <QString>
struct TeaIconSettings;

class TeaIcon {
public:
    enum Vessel {Mug=0, Teacup, JpTeacup, Gaiwan, Kyusu, Teapot};
    enum CupColor {ColorNone=0, CupBlue, CupGray, CupGreen};
    enum DrinkType {DrinkNone=0, Coffee, Rooibos, BlackTea, OolongTea, GreenTea, WhiteTea};
    QPixmap generateIcon(const TeaIconSettings &settings);
    static TeaIcon *instance();
private:
    static TeaIcon *m_instance;
    QHash < QString, QPixmap > pixmapCache;
    TeaIcon();
};

struct TeaIconSettings {
    TeaIconSettings(TeaIcon::Vessel cup, bool running, TeaIcon::CupColor color=TeaIcon::ColorNone,
                    TeaIcon::DrinkType type=TeaIcon::DrinkNone, bool teabag=false) :
                m_vessel(cup),
                m_running(running),
                m_color(color),
                m_type(type),
                m_teabag(teabag) {
    }
    TeaIconSettings() {loadFromSettings();}
    TeaIcon::Vessel m_vessel;
    bool m_running;
    TeaIcon::CupColor m_color;
    TeaIcon::DrinkType m_type;
    bool m_teabag;
    QString toString() const;
    void loadFromSettings();
    void saveToSettings();
};

#endif // TEAICON_H
